package colbert.content.testFinal;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Card {
    // 写几个银行卡的私有属性
    private String cardNum;
    private String cardName;
    private String phone;
    private double money;

    // 存金额
    public void saveMoney(double money) {
        this.money += money;
    }

    // 取金额
    public void getMoney(double money) {
        this.money -= money;
    }
    // 重写
    public String toString() {
        return "卡号：" + cardNum + "  卡名：" + cardName + "  手机号：" + phone + "  余额：" + money;
    }
}
